<?php
if($_GET['exportexcel'])
{
header("Content-Type: application/vnd.ms-excel");
header('Content-Disposition: attachment; filename="report'.time().'.xls"');
}


if (!defined('baseinfo')) {
    exitdata();
}   
include(templatepath.'/header.php');  
$arraydata[]='The Most Popular Tag';  
$arraydata[]='The total of amount Tag';     
$arraydata[]='The Most Popular Product';     
$arraydata[]='The Most Popular Member';     
$arraydata[]='The Most Popular Location';     
$arraydata[]='The Most Popular Content';     
$arraydata[]='The Most Popular Activity';     
$arraydata[]='Activity Name : Photograph Data';     
$arraydata[]='Activity Name : Article Data';     
$arraydata[]='Activity Name : Candidate Data';     
$arraydata[]='Like By';  
$arraydata[]='Share By';
$arraydata[]='Post Statistic';
   
 
?>

<div class="wrpBodyPStat">
<?if(!$_GET['exportexcel'])
{?>
    <div class="wrpHdStatP clBg1">
        <h1 class="fs09">Statistic</h1>
    </div>
<?}?>
    <div class="wrpUpdtStt clearfix">
        <div class="updtStt fs03">
            <span>Last Update : </span>
            <span><?=date("d/m/Y")?></span>
        </div>
        <?if(!$_GET['exportexcel'])
{?>
        <div class="bntDlSt">
            <input type="submit" onclick="redirectto('<?=baseinfo.'/dmmanager/statisticreport?exportexcel=1&report='.$_GET['report'].'&fid='.$_GET['fid'].'&status='.$_GET['status'].'&productid='.$_GET['productid']?>&nopage=1')" value="Download" class="btnGen btnDlStt clTxtW cutTxt clBgSp2 fs04">
        </div>
        <?}?>
    </div>
    <!-- 1 -->
    <div class="wrpItmBdStat sttP1">
        <div class="wrpHdStat">
            <h1 class="fs09"><?=$arraydata[$_GET['report']-1]?></h1>
        </div>
        <div class="itmBdStat">
            <?
//            echo "<pre>";
//            print_r($data['report']['column']);
//            echo "</pre>;";
            
            ?>
            <table class="fs03 clBd2 bdFull">
                <tbody>
                <tr class="clBg1"><th>No.</th><?if(count($data['report']['column'])){ foreach($data['report']['column'] as $valuecolumn){ echo  '<th>'.$valuecolumn['columnname'].'</th>';  }   }?></tr>
               
               
                 <?if(count($data['report']['value'])){
                    $k=(($data['pagenow'] - 1) * 100);
                    foreach($data['report']['value'] as $value)
                    {
                 ?>
                <tr <?if($k%2){ echo 'class="clBg2"';}?>><td><?=($k+1)?>.</td>
                 <?
                 if(count($data['report']['column'])){ foreach($data['report']['column'] as $valuecolumn)
                 { 
                 if($valuecolumn['link'])
                 {
                 echo '<td><a href="'.baseinfo.'/dmmanager/statisticreport?report='.$valuecolumn['link'].'&fid=&status=&productid='.$value['productid'].'"  >'.$value[$valuecolumn['name']].'</a></td>';  
                 }else if($valuecolumn['linkto'])
                 {
                 echo '<td><a target="_blank" href="'.baseinfo.'/post/'.$value['productid'].'"  >'.$value[$valuecolumn['name']].'</a></td>';  
                 
                 }                 
                 else
                 {
                 echo '<td>'.$value[$valuecolumn['name']].'</td>';  
                 }
                 
                 }   }
                 
                 
                 ?>
                
                </tr>
                <?
                     $k++;
                    }
                }?>
              <!--  <tr class="clBg2"><td>2.</td><td>Lanscape</td><td>1000</td><td>name2</td><td>1000</td><td>name2</td><td>1000</td><td>name2</td><td>1000</td></tr>
                <tr><td>3.</td><td>Lifeisfun</td><td>500</td><td>name3</td><td>500</td><td>name3</td><td>500</td><td>name3</td><td>500</td></tr>
                <tr class="clBg2"><td>4.</td><td>Lifeisstar</td><td>250</td><td>name4</td><td>250</td><td>name4</td><td>250</td><td>name4</td><td>250</td></tr>
                <tr><td>5.</td><td>Whildlife</td><td>100</td><td>name5</td><td>100</td><td>name5</td><td>100</td><td>name5</td><td>100</td></tr>
                <tr class="clBg2"><td>6.</td><td>Travel</td><td>90</td><td>name6</td><td>90</td><td>name6</td><td>90</td><td>name6</td><td>90</td></tr>
                <tr><td>7.</td><td>Monotone</td><td>80</td><td>name7</td><td>80</td><td>name7</td><td>80</td><td>name7</td><td>80</td></tr>
                <tr class="clBg2"><td>8.</td><td>Animal</td><td>70</td><td>name8</td><td>70</td><td>name8</td><td>70</td><td>name8</td><td>70</td></tr>
                <tr><td>9.</td><td>Macro</td><td>65</td><td>name9</td><td>65</td><td>name9</td><td>65</td><td>name9</td><td>65</td></tr>
                <tr class="clBg2"><td>10.</td><td>Flower</td><td>60</td><td>name10</td><td>60</td><td>name10</td><td>60</td><td>name10</td><td>60</td></tr>
                <tr><td>11.</td><td>Pretty</td><td>50</td><td>name11</td><td>50</td><td>name11</td><td>50</td><td>name11</td><td>50</td></tr>
                <tr class="clBg2"><td>12.</td><td>Girl</td><td>45</td><td>name12</td><td>45</td><td>name12</td><td>45</td><td>name12</td><td>45</td></tr>
                <tr><td>13.</td><td>Love</td><td>40</td><td>name13</td><td>40</td><td>name13</td><td>40</td><td>name13</td><td>40</td></tr>
                <tr class="clBg2"><td>14.</td><td>Underwater</td><td>35</td><td>name14</td><td>35</td><td>name14</td><td>35</td><td>name14</td><td>35</td></tr>
                <tr><td>15.</td><td>Sky</td><td>32</td><td>name15</td><td>32</td><td>name15</td><td>32</td><td>name15</td><td>32</td></tr>
                <tr class="clBg2"><td>16.</td><td>Star</td><td>30</td><td>name16</td><td>30</td><td>name16</td><td>30</td><td>name16</td><td>30</td></tr>
                <tr><td>17.</td><td>Night</td><td>20</td><td>name17</td><td>20</td><td>name17</td><td>20</td><td>name17</td><td>20</td></tr>
                <tr class="clBg2"><td>18.</td><td>Daylight</td><td>10</td><td>name18</td><td>10</td><td>name18</td><td>10</td><td>name18</td><td>10</td></tr>
                <tr><td>19.</td><td>Flash</td><td>1</td><td>name19</td><td>1</td><td>name19</td><td>1</td><td>name19</td><td>1</td></tr>
                <tr class="clBg2"><td>20.</td><td>Lifeismoney</td><td>0</td><td>name20</td><td>0</td><td>name20</td><td>0</td><td>name20</td><td>0</td></tr>-->
            </tbody></table>

        </div>
                     <div id="paginationreport"></div>
    </div>
    <!-- 2 -->
    
    <!-- 3 -->
    
    <!-- 4 -->
    
    <!-- 5 -->
    
    <!-- 6 -->
    
    <!-- 7 -->
    
    <!-- 8 -->
    
    <!-- 9 -->
    

<div class="backToT ico2 icoUp"></div></div>

<footer>
<script src="<?=baseinfo?>/js/vendor/jquery.simplePagination.js"></script>
<script>
<?if($data['limitdata']==1){?>
setpaginationdatalink('#paginationreport',<?=$data['report']['countall']?>,<?=$data['pagenow']?>,100,'<?=baseinfo.'/dmmanager/statisticreport?report='.$_GET['report'].'&fid='.$_GET['fid'].'&status='.$_GET['status'].'&productid='.$_GET['productid']?>&page=');
<?}?>

</script></footer>
</body>
</html>
<?
     

?>
